package com.ice.work.moment.facade.crawler.enums;

/**
 * @Description A股交易详情爬取字段
 * @Author DELL
 * @Create 2019-01-09
 * @Since 1.0.0
 */
@SuppressWarnings("all")
public enum TradingEnum {
    RECENT_QUOTATION("001", "recentQuotation", "最新价格"),
    PRICE_MOVEMENT_RATE("1012", "priceMovementRate", "涨跌幅"),
    PRICE_MOVEMENT("1011", "priceMovement", "涨跌值"),
    TRADING_AT("2", "tradingAt", "交易时间"),
    OPENING_PRICE("31", "openingPrice", "开盘价"),
    HIGHEST_PRICE("41", "highestPrice", "最高价"),
    AMPLITUDE("5", "amplitude", "振幅"),
    TURNOVER_RATE("6", "turnoverRate", "换手率"),
    YESTERDAY_CLOSING_PRICE("7", "yesterdayClosingPrice", "昨日收盘价"),
    BOTTOM_PRICE("81", "bottomPrice", "最低价"),
    VOLUME("9", "volume", "成交量"),
    TURNOVER("10", "turnover", "成交额");

    public String key;
    public String code;
    public String remark;

    TradingEnum(String key, String code, String remark) {
        this.key = key;
        this.code = code;
        this.remark = remark;
    }

    public static String getCodeByKey(String key) {
        for (TradingEnum gender : TradingEnum.values()) {
            if (gender.key.equals(key)) {
                return gender.code;
            }
        }
        return null;
    }
}
